﻿namespace Kivensoft.XlsReader {
	public class Column : BaseCells {

		public Column(int index):base(index) { }

		public Column(int index, bool hidden):base(index, hidden) { }

		public override void AddCell(Cell cell) {
			int max = _cells.Count;
			int index = cell.Row.Index;
			while (index >= max++) _cells.Add(null);
			cell.Column = this;
			_cells[index] = cell;
		}

		public override Cell Cell(int index) {
			return (index >= _cells.Count) ? null : _cells[index];
		}
	}
}
